<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions" 
	template = "/WEB-INF/template/templateAreaLavoroFattura.xhtml">

	<ui:define name="topAreaFattura">

		<rich:toolbar height="25">
			<a4j:commandLink id="CreaNuovoOrdine"
				action="#{tabsBean.creaNuovoOrdine(tab.name)}"
				render="pannelloParteDescrittivaOrdine tabellaLineeOrdine pannelloParteRiepilogoOrdine">
				<h:graphicImage value="/resources/img/add.png" />
				<rich:tooltip value="Crea Nuovo Ordine" for="CreaNuovoOrdine" />
			</a4j:commandLink>

			<a4j:commandLink id="SalvaOrdine"
				action="#{tabsBean.addOrdine(tab.object,tab.name)}"
				status="StatoLoading">
				<h:graphicImage value="/resources/img/salva.png" />
				<rich:tooltip value="Salva Ordine" for="SalvaOrdine" />
			</a4j:commandLink>

			<h:commandLink id="StampaOrdine"
				action="#{stampaController.stampaOrdine(tab.object)}"
				immediate="true" target="_blank"
				status="StatoLoading">
				<h:graphicImage value="/resources/img/stampa.png" />
				<rich:tooltip value="Stampa Ordine" for="StampaOrdine" />
			</h:commandLink>



		</rich:toolbar>
	</ui:define>


	<ui:define name="parteDescrittivaFattura">
		<ui:include src="/pages/Ordini/pannelloParteDescrittivaOrdine.xhtml" />
	</ui:define>
	
	<ui:define name="parteTabellareFattura">
		<ui:include src="/pages/Ordini/pannelloParteTabellareOrdine.xhtml" />
	</ui:define>
	
	<ui:define name="parteRiepilogoFattura">
		<ui:include src="/pages/Ordini/pannelloRiepilogoOrdine.xhtml" />
	</ui:define>
	
	
	
	<ui:define name="workAreaOrdineFattura">
	<fieldset>
		<legend><b>Inserimento Nuovo Ordine</b></legend>
			<ui:include src="/pages/Ordini/pannelloInserimentoOrdine.xhtml" />
	</fieldset>
	</ui:define>

	<ui:define name="messageAreaFattura">
		<a4j:outputPanel ajaxRendered="true">
			<c:set var="recordStatus" value="#{tab.statusRecord}"></c:set>

			<c:choose>
				<c:when test="${fn:containsIgnoreCase(recordStatus,'errore')}">
					<h:outputLabel id="labelErroreSalvataggioOrdine"
						value="#{tab.statusRecord}" styleClass="messageClass" />
					<rich:jQuery selector="#messageAreaFattura" query="addClass('errorClass')" />
				</c:when>
				<c:when test="${fn:containsIgnoreCase(recordStatus,'successo')}">
					<h:outputLabel id="labelSuccessSalvataggioOrdine"
						value="#{tab.statusRecord}" styleClass="messageClass" />
					<rich:jQuery selector="#messageAreaFattura" query="addClass('successClass')" />
				</c:when>
			</c:choose>
			
		</a4j:outputPanel>
	</ui:define>


</ui:composition>